package net.logax.games.chase;

import javax.microedition.khronos.opengles.GL10;

import net.logax.games.framework.gl.Vertices3;

public class ModelLinePlotter {
	GL10 gl;

	public ModelLinePlotter(GL10 gl) {
		this.gl = gl;
	}

	public void plot(RenderableGameObject gameObject) {
		Vertices3 model = gameObject.getModel();
		model.bind();
		gl.glPushMatrix();
		float x = gameObject.position.x;
		float y = gameObject.position.y;
		float z = gameObject.position.z;
		gl.glTranslatef(x, y, z);
		gl.glLineWidth(1.0f);
		int primitiveType = GL10.GL_LINES;
		model.draw(primitiveType, 0, model.getNumVertices());
		gl.glPopMatrix();
		model.unbind();
	}
}
